<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
    <script src="/layui/layui.js" charset="utf-8"></script>
    <%--<script src="/layui/layui.all.js" charset="utf-8"></script>--%>
</head>
<body>
<div style="margin: 150px auto;width: 60%">
<form class="layui-form layui-form-pane" action="/role/edit">
    <input type="hidden" name="oid" value="${role.oid}">
    <input type="hidden" name="rname" value="${role.oname}">
    <div class="layui-form-item">
        <label class="layui-form-label">角色名称</label>
        <div class="layui-input-block">
            <input type="text" name="oname" value="${role.oname}" required lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">描述</label>
        <div class="layui-input-block">
            <input type="text" name="odesc" value="${role.odesc}" required lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo" onclick="return editorder();">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
</div>

<script>
    function editorder() {
        var cho = document.getElementById("chorder").value;
        if (isNaN(cho)) {
            alert('排序号必须为数字');
            return false;
        }
    }
    layui.use(['form', 'layedit', 'laydate']);
</script>
</body>
</html>
